int judge(int x)
{
    int tmp = x;
    int sum = 0;
    while (tmp > 0)
    {
        sum = sum * 10 + tmp % 10;
        tmp /= 10;
    }
    if (sum == x)
        return 1;
    return 0;
}

int minpalindromes(int x)
{
    for (int i = x;; i++)
    {
        if (judge(i))
            return i;
    }
}